/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package com.thalesgroup.preferenceFramework.models.LCPnet.provider;

import com.thalesgroup.preferenceFramework.models.LCPnet.util.LCPnetAdapterFactory;

import java.util.ArrayList;
import java.util.Collection;

import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;

import org.eclipse.emf.edit.provider.ChangeNotifier;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.edit.provider.IChangeNotifier;
import org.eclipse.emf.edit.provider.IDisposable;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.INotifyChangedListener;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;

/**
 * This is the factory that is used to provide the interfaces needed to support Viewers.
 * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}.
 * The adapters also support Eclipse property sheets.
 * Note that most of the adapters are shared among multiple instances.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public class LCPnetItemProviderAdapterFactory extends LCPnetAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable {
	/**
	 * This keeps track of the root adapter factory that delegates to this adapter factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ComposedAdapterFactory parentAdapterFactory;

	/**
	 * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected IChangeNotifier changeNotifier = new ChangeNotifier();

	/**
	 * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected Collection<Object> supportedTypes = new ArrayList<Object>();

	/**
	 * This constructs an instance.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public LCPnetItemProviderAdapterFactory() {
		supportedTypes.add(IEditingDomainItemProvider.class);
		supportedTypes.add(IStructuredItemContentProvider.class);
		supportedTypes.add(ITreeItemContentProvider.class);
		supportedTypes.add(IItemLabelProvider.class);
		supportedTypes.add(IItemPropertySource.class);
	}

	/**
	 * This keeps track of the one adapter used for all {@link com.thalesgroup.preferenceFramework.models.LCPnet.LCPnet} instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected LCPnetItemProvider lcPnetItemProvider;

	/**
	 * This creates an adapter for a {@link com.thalesgroup.preferenceFramework.models.LCPnet.LCPnet}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter createLCPnetAdapter() {
		if (lcPnetItemProvider == null) {
			lcPnetItemProvider = new LCPnetItemProvider(this);
		}

		return lcPnetItemProvider;
	}

	/**
	 * This keeps track of the one adapter used for all {@link com.thalesgroup.preferenceFramework.models.LCPnet.LinguisticDomain} instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected LinguisticDomainItemProvider linguisticDomainItemProvider;

	/**
	 * This creates an adapter for a {@link com.thalesgroup.preferenceFramework.models.LCPnet.LinguisticDomain}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter createLinguisticDomainAdapter() {
		if (linguisticDomainItemProvider == null) {
			linguisticDomainItemProvider = new LinguisticDomainItemProvider(this);
		}

		return linguisticDomainItemProvider;
	}

	/**
	 * This keeps track of the one adapter used for all {@link com.thalesgroup.preferenceFramework.models.LCPnet.LinguisticSubset} instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected LinguisticSubsetItemProvider linguisticSubsetItemProvider;

	/**
	 * This creates an adapter for a {@link com.thalesgroup.preferenceFramework.models.LCPnet.LinguisticSubset}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter createLinguisticSubsetAdapter() {
		if (linguisticSubsetItemProvider == null) {
			linguisticSubsetItemProvider = new LinguisticSubsetItemProvider(this);
		}

		return linguisticSubsetItemProvider;
	}

	/**
	 * This keeps track of the one adapter used for all {@link com.thalesgroup.preferenceFramework.models.LCPnet.LNode} instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected LNodeItemProvider lNodeItemProvider;

	/**
	 * This creates an adapter for a {@link com.thalesgroup.preferenceFramework.models.LCPnet.LNode}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter createLNodeAdapter() {
		if (lNodeItemProvider == null) {
			lNodeItemProvider = new LNodeItemProvider(this);
		}

		return lNodeItemProvider;
	}

	/**
	 * This keeps track of the one adapter used for all {@link com.thalesgroup.preferenceFramework.models.LCPnet.CLPT} instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CLPTItemProvider clptItemProvider;

	/**
	 * This creates an adapter for a {@link com.thalesgroup.preferenceFramework.models.LCPnet.CLPT}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter createCLPTAdapter() {
		if (clptItemProvider == null) {
			clptItemProvider = new CLPTItemProvider(this);
		}

		return clptItemProvider;
	}

	/**
	 * This keeps track of the one adapter used for all {@link com.thalesgroup.preferenceFramework.models.LCPnet.CLPTLine} instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CLPTLineItemProvider clptLineItemProvider;

	/**
	 * This creates an adapter for a {@link com.thalesgroup.preferenceFramework.models.LCPnet.CLPTLine}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter createCLPTLineAdapter() {
		if (clptLineItemProvider == null) {
			clptLineItemProvider = new CLPTLineItemProvider(this);
		}

		return clptLineItemProvider;
	}

	/**
	 * This keeps track of the one adapter used for all {@link com.thalesgroup.preferenceFramework.models.LCPnet.CNodeValue} instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CNodeValueItemProvider cNodeValueItemProvider;

	/**
	 * This creates an adapter for a {@link com.thalesgroup.preferenceFramework.models.LCPnet.CNodeValue}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter createCNodeValueAdapter() {
		if (cNodeValueItemProvider == null) {
			cNodeValueItemProvider = new CNodeValueItemProvider(this);
		}

		return cNodeValueItemProvider;
	}

	/**
	 * This keeps track of the one adapter used for all {@link com.thalesgroup.preferenceFramework.models.LCPnet.LNodeValue} instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected LNodeValueItemProvider lNodeValueItemProvider;

	/**
	 * This creates an adapter for a {@link com.thalesgroup.preferenceFramework.models.LCPnet.LNodeValue}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter createLNodeValueAdapter() {
		if (lNodeValueItemProvider == null) {
			lNodeValueItemProvider = new LNodeValueItemProvider(this);
		}

		return lNodeValueItemProvider;
	}

	/**
	 * This keeps track of the one adapter used for all {@link com.thalesgroup.preferenceFramework.models.LCPnet.LNodeValueUtility} instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected LNodeValueUtilityItemProvider lNodeValueUtilityItemProvider;

	/**
	 * This creates an adapter for a {@link com.thalesgroup.preferenceFramework.models.LCPnet.LNodeValueUtility}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter createLNodeValueUtilityAdapter() {
		if (lNodeValueUtilityItemProvider == null) {
			lNodeValueUtilityItemProvider = new LNodeValueUtilityItemProvider(this);
		}

		return lNodeValueUtilityItemProvider;
	}

	/**
	 * This keeps track of the one adapter used for all {@link com.thalesgroup.preferenceFramework.models.LCPnet.Coordinate} instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CoordinateItemProvider coordinateItemProvider;

	/**
	 * This creates an adapter for a {@link com.thalesgroup.preferenceFramework.models.LCPnet.Coordinate}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter createCoordinateAdapter() {
		if (coordinateItemProvider == null) {
			coordinateItemProvider = new CoordinateItemProvider(this);
		}

		return coordinateItemProvider;
	}

	/**
	 * This keeps track of the one adapter used for all {@link com.thalesgroup.preferenceFramework.models.LCPnet.COutcome} instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected COutcomeItemProvider cOutcomeItemProvider;

	/**
	 * This creates an adapter for a {@link com.thalesgroup.preferenceFramework.models.LCPnet.COutcome}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter createCOutcomeAdapter() {
		if (cOutcomeItemProvider == null) {
			cOutcomeItemProvider = new COutcomeItemProvider(this);
		}

		return cOutcomeItemProvider;
	}

	/**
	 * This keeps track of the one adapter used for all {@link com.thalesgroup.preferenceFramework.models.LCPnet.LTwoTuple} instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected LTwoTupleItemProvider lTwoTupleItemProvider;

	/**
	 * This creates an adapter for a {@link com.thalesgroup.preferenceFramework.models.LCPnet.LTwoTuple}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter createLTwoTupleAdapter() {
		if (lTwoTupleItemProvider == null) {
			lTwoTupleItemProvider = new LTwoTupleItemProvider(this);
		}

		return lTwoTupleItemProvider;
	}

	/**
	 * This keeps track of the one adapter used for all {@link com.thalesgroup.preferenceFramework.models.LCPnet.IArc} instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected IArcItemProvider iArcItemProvider;

	/**
	 * This creates an adapter for a {@link com.thalesgroup.preferenceFramework.models.LCPnet.IArc}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter createIArcAdapter() {
		if (iArcItemProvider == null) {
			iArcItemProvider = new IArcItemProvider(this);
		}

		return iArcItemProvider;
	}

	/**
	 * This keeps track of the one adapter used for all {@link com.thalesgroup.preferenceFramework.models.LCPnet.CIArc} instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CIArcItemProvider ciArcItemProvider;

	/**
	 * This creates an adapter for a {@link com.thalesgroup.preferenceFramework.models.LCPnet.CIArc}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter createCIArcAdapter() {
		if (ciArcItemProvider == null) {
			ciArcItemProvider = new CIArcItemProvider(this);
		}

		return ciArcItemProvider;
	}

	/**
	 * This keeps track of the one adapter used for all {@link com.thalesgroup.preferenceFramework.models.LCPnet.CIT} instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CITItemProvider citItemProvider;

	/**
	 * This creates an adapter for a {@link com.thalesgroup.preferenceFramework.models.LCPnet.CIT}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter createCITAdapter() {
		if (citItemProvider == null) {
			citItemProvider = new CITItemProvider(this);
		}

		return citItemProvider;
	}

	/**
	 * This keeps track of the one adapter used for all {@link com.thalesgroup.preferenceFramework.models.LCPnet.CITLine} instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CITLineItemProvider citLineItemProvider;

	/**
	 * This creates an adapter for a {@link com.thalesgroup.preferenceFramework.models.LCPnet.CITLine}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter createCITLineAdapter() {
		if (citLineItemProvider == null) {
			citLineItemProvider = new CITLineItemProvider(this);
		}

		return citLineItemProvider;
	}

	/**
	 * This returns the root adapter factory that contains this factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ComposeableAdapterFactory getRootAdapterFactory() {
		return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
	}

	/**
	 * This sets the composed adapter factory that contains this factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) {
		this.parentAdapterFactory = parentAdapterFactory;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean isFactoryForType(Object type) {
		return supportedTypes.contains(type) || super.isFactoryForType(type);
	}

	/**
	 * This implementation substitutes the factory itself as the key for the adapter.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Adapter adapt(Notifier notifier, Object type) {
		return super.adapt(notifier, this);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object adapt(Object object, Object type) {
		if (isFactoryForType(type)) {
			Object adapter = super.adapt(object, type);
			if (!(type instanceof Class) || (((Class<?>)type).isInstance(adapter))) {
				return adapter;
			}
		}

		return null;
	}

	/**
	 * This adds a listener.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void addListener(INotifyChangedListener notifyChangedListener) {
		changeNotifier.addListener(notifyChangedListener);
	}

	/**
	 * This removes a listener.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void removeListener(INotifyChangedListener notifyChangedListener) {
		changeNotifier.removeListener(notifyChangedListener);
	}

	/**
	 * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void fireNotifyChanged(Notification notification) {
		changeNotifier.fireNotifyChanged(notification);

		if (parentAdapterFactory != null) {
			parentAdapterFactory.fireNotifyChanged(notification);
		}
	}

	/**
	 * This disposes all of the item providers created by this factory. 
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void dispose() {
		if (lcPnetItemProvider != null) lcPnetItemProvider.dispose();
		if (linguisticDomainItemProvider != null) linguisticDomainItemProvider.dispose();
		if (linguisticSubsetItemProvider != null) linguisticSubsetItemProvider.dispose();
		if (lNodeItemProvider != null) lNodeItemProvider.dispose();
		if (clptItemProvider != null) clptItemProvider.dispose();
		if (clptLineItemProvider != null) clptLineItemProvider.dispose();
		if (cNodeValueItemProvider != null) cNodeValueItemProvider.dispose();
		if (lNodeValueItemProvider != null) lNodeValueItemProvider.dispose();
		if (lNodeValueUtilityItemProvider != null) lNodeValueUtilityItemProvider.dispose();
		if (coordinateItemProvider != null) coordinateItemProvider.dispose();
		if (cOutcomeItemProvider != null) cOutcomeItemProvider.dispose();
		if (lTwoTupleItemProvider != null) lTwoTupleItemProvider.dispose();
		if (iArcItemProvider != null) iArcItemProvider.dispose();
		if (ciArcItemProvider != null) ciArcItemProvider.dispose();
		if (citItemProvider != null) citItemProvider.dispose();
		if (citLineItemProvider != null) citLineItemProvider.dispose();
	}

}
